using System;
using PCC.App;
using PCC.CQRS;

namespace PCC.Receiver.Database
{
    public abstract class AbstractDatabaseReceiver : IReceiver, IDisposable
    {
        protected readonly DataManager _dataManager;

        protected AbstractDatabaseReceiver(DataManager dataManager)
        {
            _dataManager = dataManager;
        }

        public abstract void Action();

        /// <summary>
        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
        /// </summary>
        /// <filterpriority>2</filterpriority>
        public void Dispose()
        {
            _dataManager.Dispose();
        }
    }
}